<script setup>
import { ref } from 'vue'

const isMobileMenuOpen = ref(false)

function toggleMobileMenu() {
  isMobileMenuOpen.value = !isMobileMenuOpen.value
}
</script>

<template>
  <div id="app">
    <!-- 导航栏 -->
    <header class="header">
      <div class="container">
        <div class="nav-content">
          <div class="logo-section">
            <img alt="AI Agent Logo" class="logo" src="./assets/logo.svg" />
            <span class="logo-text">AI Agent Hub</span>
          </div>
          <nav class="nav-menu">
            <router-link to="/" class="nav-link">主页</router-link>
            <router-link to="/love-master" class="nav-link">AI恋爱大师</router-link>
            <router-link to="/super-agent" class="nav-link">AI超级智能体</router-link>
          </nav>
          <div class="nav-toggle" @click="toggleMobileMenu">
            <span></span>
            <span></span>
            <span></span>
          </div>
        </div>
      </div>
    </header>

    <!-- 主要内容 -->
    <main class="main-content">
      <router-view />
    </main>

    <!-- 页脚 -->
    <footer class="footer">
      <div class="container">
        <div class="footer-content">
          <div class="footer-section">
            <h3 class="footer-title">AI Agent Hub</h3>
            <p class="footer-description">
              专业的AI智能体平台，提供多种AI应用服务，让AI成为你的得力助手。
            </p>
          </div>
          <div class="footer-section">
            <h4 class="footer-subtitle">应用服务</h4>
            <ul class="footer-links">
              <li><router-link to="/love-master">AI恋爱大师</router-link></li>
              <li><router-link to="/super-agent">AI超级智能体</router-link></li>
            </ul>
          </div>
          <div class="footer-section">
            <h4 class="footer-subtitle">联系我们</h4>
            <ul class="footer-links">
              <li><a href="mailto:2992932730@qq.com">2992932730@qq.com</a></li>
              <li><a href="https://gitee.com/xi-yunxin/xi-ai-agent.git" target="_blank">Gitee</a></li>
            </ul>
          </div>
        </div>
        <div class="footer-bottom">
          <div class="copyright">
            <p>&copy; 2024 AI Agent Hub. All rights reserved.</p>
            <p>Powered by cutting-edge AI technology</p>
          </div>
          <div class="footer-legal">
            <a href="/privacy">隐私政策</a>
            <a href="/terms">服务条款</a>
          </div>
        </div>
      </div>
    </footer>
  </div>
</template>

<style scoped>
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 导航栏样式 */
.header {
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 10px var(--primary-color));
}

.logo-text {
  font-size: 1.5rem;
  font-weight: bold;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.router-link-active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.router-link-active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--primary-color);
  transition: all 0.3s ease;
}

/* 主要内容 */
.main-content {
  flex: 1;
  padding: 2rem 0;
}

/* 页脚样式 */
.footer {
  background: var(--darker-bg);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 1rem;
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-subtitle {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-description {
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

.copyright p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.footer-legal {
  display: flex;
  gap: 1rem;
}

.footer-legal a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-legal a:hover {
  color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .main-content {
    padding: 1rem 0;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .nav-menu {
    gap: 1.5rem;
  }
  
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}
</style>
